<div class="panes_vertical">
	<div class="box">	
		<form method="post" action="<{$APPLICATION_URL}>/Admin/Settings/payment" name="frmPaypalForm" enctype="multipart/form-data">
			<fieldset>
				<legend>Paypal API Settings</legend>	
				<{if $paypal_enable == "0"}>
				<p>
					<h4 style="color:red;">PAYPAL GATEWAY IS DISBALED.</h4>
				</p>
				<{/if}>
				<p>
					<label>API Username:</label>
					<input type='text' id='username' name='username' value='<{$paypal_username}>' class="textfield" style="width: 30%;" max-length="255">					
				</p>
				<p>
					<label>API Password:</label>
					<input type='text' id='password' name='password' value='<{$paypal_password}>' class="textfield" style="width: 30%;" max-length="255">					
				</p>				
				<p>
					<label>API Signature:</label>
					<input type='text' id='signature' name='signature' value='<{$paypal_signature}>' class="textfield" style="width: 30%;" max-length="255">					
				</p>				
				<p>					
					<input type="checkbox" name="testmode" <{if $paypal_testmode == "1"}> checked="checked"<{/if}> /><b> Test Mode</b>
					<input type="checkbox" name="paypal_enable" value="on" <{if $paypal_enable == "1"}> checked="checked"<{/if}> /><b> Enable</b>
				</p>
				<p>
					<input type="button" name="save" class="button" id="save" value=" Update " onclick="paypalSubmit();" />					
					<input type="hidden" id="actionForm" name="actionForm" value=""/>
					<input type="hidden" id="actionKey" name="actionKey" value="<{$actionKey}>" />
				</p>
			</fieldset>
		</form>
	</div>
</div>
<script type="text/javascript">
    function paypalSubmit()
    {
    	var theform = document.frmPaypalForm;
    	
		// Check username
    	var username = theform.username.value;
    	if (username == ''){
			alert('Username is invalid. Please fill a valid username.');
			theform.username.focus();
			return false;
    	}
		
    	// Check password
    	var password = theform.password.value;
    	if (password == ''){
			alert('Password is invalid');
			theform.password.focus();
			return false;
    	} 	
		
		// Check signature
    	var signature = theform.signature.value;
    	if (signature == ''){
			alert('Signature is invalid');
			theform.signature.focus();
			return false;
    	}

    	theform.actionForm.value = 'paypal_update';
    	theform.submit();
    	return true;
    }
</script>
<div class="panes_vertical">
	<div class="box">	
		<form method="post" action="<{$APPLICATION_URL}>/Admin/Settings/payment" name="frm2checkoutForm" enctype="multipart/form-data">
			<fieldset>
				<legend>2Checkout API Settings</legend>		
				<{if $checkout_enable == "0"}>
				<p>
					<h4 style="color:red;">2CHECKOUT GATEWAY IS DISBALED.</h4>
				</p>
				<{/if}>				
				<p>
					<label>API Username:</label>
					<input type='text' id='username' name='username' value='<{$checkout_username}>' class="textfield" style="width: 30%;" max-length="255">					
				</p>
				<p>
					<label>API Password:</label>
					<input type='text' id='password' name='password' value='<{$checkout_password}>' class="textfield" style="width: 30%;" max-length="255">					
				</p>	
				<p>					
					<input type="checkbox" name="testmode" <{if $checkout_testmode == "1"}> checked="checked"<{/if}> ><b> Test Mode</b>
					<input type="checkbox" name="checkout_enable" value="on" <{if $checkout_enable == "1"}> checked="checked"<{/if}> ><b> Enable</b>
				</p>				
				<p>
					<input type="button" name="save" class="button" id="save" value=" Update " onclick="checkoutSubmit();" />					
					<input type="hidden" id="actionForm" name="actionForm" value=""/>
					<input type="hidden" id="actionKey" name="actionKey" value="<{$actionKey}>" />
				</p>
			</fieldset>
		</form>
	</div>
</div>
<script type="text/javascript">
    function checkoutSubmit()
    {
    	var theform = document.frm2checkoutForm;
    	
		// Check Vendor ID
    	var username = theform.username.value;
    	if (username == ''){
			alert('VendorID cannot be NULL.');
			theform.username.focus();
			return false;
    	}
		
    	// Check Secret Word
    	var password = theform.password.value;
    	if (password == ''){
			alert('Secret Word cannot be NULL.');
			theform.password.focus();
			return false;
    	} 	

    	theform.actionForm.value = '2checkout_update';
    	theform.submit();
    	return true;
    }
</script>

